import { Pipe, PipeTransform } from '@angular/core'
import * as moment from 'moment';


@Pipe({
  name: 'date'
})
export class Date implements PipeTransform {
  	transform(value: string, ...args): string {
  		// return moment(value, ["YYYYMMDDHHmm" ,"MM-DD HH:mm"])
  		// moment("12-25-1995", ["MM-DD-YYYY", "YYYY-MM-DD"]);
  		return value.substring(4,6)+'-'+value.substring(6,8)+' '+value.substring(8,10)+':'+value.substring(10,12);
  	}
}

@Pipe({
  name: 'date1'
})
export class Date1 implements PipeTransform {
  	transform(value: string, ...args): string {
  		return moment(value).format("YYYY-MM-DD HH:mm:ss")
  	}
}

